#pragma once

#include <ext/hash_fun.h>
#include <ext/hash_map>

// gnu hash_map hash functions
namespace __gnu_cxx
{
	using std::size_t;

	// hash for pointer
	template<typename T>
	struct hash<T*>
	{
		inline size_t operator()(T* __x) const
		{
			return reinterpret_cast<size_t>(__x);
		}
	};

	// hash for string
	template<>
	struct hash<std::string> {
		inline size_t operator()(std::string __x) const
		{
			return __stl_hash_string(__x.c_str());
		}
	};

	// hash for const string
	template<>
	struct hash<const std::string&>
	{
		inline size_t operator()(const std::string& __x) const
		{
			return __stl_hash_string(__x.c_str());
		}
	};
}

#define hash_map __gnu_cxx::hash_map

